﻿

using System;
using System.Collections.Generic;

namespace Demo.Domain
{
    public interface IModuleRepository
    {
        /// <summary>
        /// 创建模块
        /// </summary>
        /// <param name="name">模块名称</param>
        /// <param name="sort">排序值</param>
        void CreateModule(string name, Int32 sort = 0);

        /// <summary>
        /// 获取模块DTO
        /// </summary>
        /// <param name="name">模块名称</param>
        /// <returns></returns>
        Module GetModuleWithName(string name);

        /// <summary>
        /// 获取模块DTO
        /// </summary>
        /// <param name="id">模块ID</param>
        /// <returns></returns>
        Module GetModuleWithId(Int32 id);

        /// <summary>
        /// 获取所有模块
        /// </summary>
        /// <param name="userid">用户ID</param>
        /// <returns></returns>
        IList<Module> GetModuleWithUserId(Int32 userid);

        /// <summary>
        /// 获取所有的模块
        /// </summary>
        /// <returns></returns>
        IList<Module> GetModule();

        /// <summary>
        /// 更改模块
        /// </summary>
        /// <param name="oldName">旧模块名称</param>
        /// <param name="newName">新模块名称</param>
        /// <returns></returns>
        bool ChangeModuleWithName(string oldName, string newName);

        /// <summary>
        /// 更改名称
        /// </summary>
        /// <param name="Name">模块名称</param>
        /// <param name="oleSort">旧排序值</param>
        /// <param name="newSort">新排序值</param>
        /// <returns></returns>
        //bool ChangeModuleWithName(string Name,  Int32 newSort);

    }
}
